package edu.sctu.zhangwang.month201506.day20150628.test_day0628.judge_price;

import edu.sctu.zhangwang.month201506.day20150628.test_day0628.json_data.JsonApp;
import edu.sctu.zhangwang.month201506.day20150628.test_day0628.json_data.Json_data;

import java.io.*;

/**
 * Created by Administrator on 2015/6/28.
 */
public class CreatApp {
        public void creat_App(){
            File file = new File("D://Json/Appbean.txt");
                /**
                 * 序列化
                 */
            try {
                Json_data jsonApp = new Json_data();
                ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file));
                out.writeObject(jsonApp);
                System.out.println("序列化成功。");
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                ObjectInputStream input = new ObjectInputStream(new FileInputStream(file));
                try {
                    input.readObject();
                } catch (ClassNotFoundException e) {
                    e.printStackTrace();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    public static void main(String[] args) {
        CreatApp creatApp = new CreatApp();
        creatApp.creat_App();
    }
}
